package com.wonders.hs.pd.mm.web.message;

import com.corundumstudio.socketio.SocketIOServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author banglong on 2017/2/4.
 */
@Component
public class ServerRunner implements CommandLineRunner {

  private final SocketIOServer server;

  @Autowired
  public ServerRunner(SocketIOServer server) {
    this.server = server;
  }

  @Override
  public void run(String... strings) throws Exception {
    // todo 开启 socketio 服务器
//    server.start();
    // 监听文件 定时发送 公告信息
//    ExecutorService executor = Executors.newSingleThreadExecutor();
//    executor.submit(MessageHandler::watchMsgFile);
  }
}
